﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Resources;

namespace Cash_n_guns
{
    public partial class NewPlayerControl : UserControl
    {
        ResourceManager rm = new ResourceManager("Cash_n_guns.gameImages", Assembly.GetExecutingAssembly());
        private Character m_character;
        public NewPlayerControl()
        {
            InitializeComponent();
        }
        
        private void m_rdbMrBlack_CheckedChanged(object sender, EventArgs e)
        {
            if (m_rdbMrBlack.Checked)
            {
               // m_pbxCharacter.Image = null;
               // m_rdbMrBlack.Checked = true;
                m_rdbLotus.Checked = false;
                m_rdbIgor.Checked = false;
                m_rdbHuggy.Checked = false;
                m_rdbElToro.Checked = false;
                m_rdbTino.Checked = false;
             //   m_pbxCharacter.Image = (Bitmap)rm.GetObject("mrBlack");

                m_character = new Character(CharacterSelector.mrBlack);

                m_pbxCharacter.Image = (Bitmap)rm.GetObject(m_character.CharacterImageName);
            }
        }

        private void m_rdbElToro_CheckedChanged(object sender, EventArgs e)
        {
            if (m_rdbElToro.Checked)
            {
             //   m_pbxCharacter.Image = null;
                m_rdbMrBlack.Checked = false;
                m_rdbLotus.Checked = false;
                m_rdbIgor.Checked = false;
                m_rdbHuggy.Checked = false;
             //   m_rdbElToro.Checked = true;
                m_rdbTino.Checked = false;
                //m_pbxCharacter.Image = (Bitmap)rm.GetObject("elToro");

                m_character = new Character(CharacterSelector.elToro);

                m_pbxCharacter.Image = (Bitmap) rm.GetObject(m_character.CharacterImageName);
            }
        }

        private void m_rdbHuggy_CheckedChanged(object sender, EventArgs e)
        {
            if (m_rdbHuggy.Checked)
            {
             //   m_pbxCharacter.Image = null;
                m_rdbMrBlack.Checked = false;
                m_rdbLotus.Checked = false;
                m_rdbIgor.Checked = false;
           //     m_rdbHuggy.Checked = true;
                m_rdbElToro.Checked = false;
                m_rdbTino.Checked = false;
              //  m_pbxCharacter.Image = (Bitmap)rm.GetObject("huggy");

                m_character = new Character(CharacterSelector.huggy);

                m_pbxCharacter.Image = (Bitmap)rm.GetObject(m_character.CharacterImageName);
            }
        }

        private void m_rdbIgor_CheckedChanged(object sender, EventArgs e)
        {
            if (m_rdbIgor.Checked)
            {
             //   m_pbxCharacter.Image = null;
                m_rdbMrBlack.Checked = false;
                m_rdbLotus.Checked = false;
             //   m_rdbIgor.Checked = true;
                m_rdbHuggy.Checked = false;
                m_rdbElToro.Checked = false;
                m_rdbTino.Checked = false;
               // m_pbxCharacter.Image = (Bitmap)rm.GetObject("igor");

                m_character = new Character(CharacterSelector.igor);

                m_pbxCharacter.Image = (Bitmap)rm.GetObject(m_character.CharacterImageName);
            }
        }

        private void m_rdbLotus_CheckedChanged(object sender, EventArgs e)
        {
            if (m_rdbLotus.Checked)
            {
            //    m_pbxCharacter.Image = null;
                m_rdbMrBlack.Checked = false;
           //     m_rdbLotus.Checked = true;
                m_rdbIgor.Checked = false;
                m_rdbHuggy.Checked = false;
                m_rdbElToro.Checked = false;
                m_rdbTino.Checked = false;
               // m_pbxCharacter.Image = (Bitmap)rm.GetObject("lotus");
                m_character = new Character(CharacterSelector.lotus);

                m_pbxCharacter.Image = (Bitmap)rm.GetObject(m_character.CharacterImageName);
            }
        }

        private void m_rdbTino_CheckedChanged(object sender, EventArgs e)
        {
            if (m_rdbTino.Checked)
            {
           //     m_pbxCharacter.Image = null;
                m_rdbMrBlack.Checked = false;
                m_rdbLotus.Checked = false;
                m_rdbIgor.Checked = false;
                m_rdbHuggy.Checked = false;
                m_rdbElToro.Checked = false;
           //     m_rdbTino.Checked = true;
             //   m_pbxCharacter.Image = (Bitmap)rm.GetObject("tino");                
                m_character = new Character(CharacterSelector.tino);

                m_pbxCharacter.Image = (Bitmap)rm.GetObject(m_character.CharacterImageName);
            }
        }
    }
}
